package com.zqf.test;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class GetCameraInfo extends HttpServlet {

	/**
	 * Constructor of the object.
	 */
	public GetCameraInfo() {
		super();
	}

	/**
	 * Destruction of the servlet. <br>
	 */
	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
		// Put your code here
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		this.doPost(request, response);
	}
	
	
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		
		response.setCharacterEncoding("utf-8");
		String cameraInfo = request.getParameter("jsonpcallback");
		String info="{\"code\":\"code\",\"msg\":\"msg\",\"status\":\"status\",\"resolution_x\":\"resolution_x\",\"resolution_y\":\"resolution_y\",\"model\":\"model\"}";
		info=cameraInfo+"("+info+")";
		System.out.println(info);
		response.getWriter().print(info);
	}

	/**
	 * Initialization of the servlet. <br>
	 *
	 * @throws ServletException if an error occurs
	 */
	public void init() throws ServletException {
		// Put your code here
	}

}
